﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Baby.GrowUp.Web.Admin.Login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>宝贝成长-登录</title>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/common.js"></script>
    <link href="../css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/login.css" rel="stylesheet" />
    <link href="../css/message.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function () {
            $('[data-toggle="tooltip"]').tooltip();
        });

        function checkInput() {
            var $btn = $(this).button('loading');
            var userName = $('#txtUserName');
            var pwd = $('#txtPassword');
            var code = $('#txtCode');
            var isErr = false;

            if (userName.val() == '') {
                userName.tooltip('show');
                isErr = true;
            }

            if (pwd.val() == '') {
                pwd.tooltip('show');
                isErr = true;
            }

            if (code.val() == '') {
                code.tooltip('show');
                isErr = true;
            }

            if (isErr) {
                $btn.button('reset');
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="container">
            <div class="login center-block">
                <div class="well">
                    <div class="page-header">
                        <h1>宝贝成长<small>请先登录</small></h1>
                    </div>
                    <div class="form-group">
                        <asp:TextBox runat="server" ID="txtUserName" CssClass="form-control" placeholder="请输入用户名" data-toggle="tooltip" data-placement="left" title="请输入用户名！" ClientIDMode="Static"></asp:TextBox>
                    </div>
                    <div class="form-group">
                        <asp:TextBox runat="server" ID="txtPassword" CssClass="form-control" placeholder="请输入密码" TextMode="Password" data-toggle="tooltip" data-placement="left" title="请输入密码！" ClientIDMode="Static"></asp:TextBox>
                    </div>
                    <div class="row" style="margin-bottom: 15px;">
                        <div class="col-md-6">
                            <div class="form-group">
                                <asp:TextBox runat="server" ID="txtCode" CssClass="form-control" placeholder="请输入验证码" data-toggle="tooltip" data-placement="left" title="请输入验证码！" ClientIDMode="Static"></asp:TextBox>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <img style="width: 215px; height: 34px;" class="img-rounded" />
                            </div>
                        </div>
                    </div>
                    <div class="line"></div>
                    <div class="form-group">
                        <asp:Button runat="server" ID="btnLogin" data-loading-text="Loading..." Text="立即登录" CssClass="btn btn-primary btn-block" ClientIDMode="Static" OnClientClick="return checkInput()" OnClick="UserLogin" />
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
